 <%@ include file="../common.jsp" %>
 <script type="text/javascript">
	$(document).ready(
		function(){
			enableDatepicker('docValidityStartDate','dd-mm-yy');
			enableDatepicker('docValidityEndDate','dd-mm-yy');
			enableDisableFields('docRenewableSelect');
		}
	);
	loadCategAndSubCategForReports();
</script>
 
 <div id="reportsFilter">
	 <form:form commandName="reportsForm" id="submitFilterDetails">
	 	<table class="viewDetails">
	 		<tr class="heading"> <td colspan="8"> Filters: </td> </tr>
	 		
	 		<tr class="even"> 
		 		<td> Name of Document </td>
		 		<td> <form:input path="docName" type="text" id="docName" /></td> 
		 		
		 		<td> Document Type </td>
		 		<td> <form:select path="docTypeId" id="docTypeId">
		 					<form:option value="0">ALL</form:option>
		 				<c:forEach items="${docTypeMap}" var="docTypeMap">
		 					<form:option value="${docTypeMap.value.dtId}">${docTypeMap.value.dtName}</form:option>
		 				</c:forEach>
		 			 </form:select> 
		 		</td>
		 				 		 
		 		<td> Document Category </td>
		 		<td> <form:select path="docCategoryId" id="docCategoryId"> </form:select> </td>
		 	</tr>
		 	<tr class="odd">
		 	 	<td> Document Sub-Category </td>
		 		<td> <form:select path="docSubCategoryId" id="docSubCategoryId"> </form:select> </td>
		 			 		 
		 		<td> Business Unit </td>
		 		<td> <form:select path="docLocId" id="docLocId" onchange="loadDepttForBUForReports(this.id,'docDepttId');">
		 					<form:option value="">Choose Unit</form:option>
		 					<form:option value="0">ALL</form:option>
		 				<c:forEach items="${businessUnitMap}" var="businessUnitMap">
		 					<form:option value="${businessUnitMap.value.ldId}">${businessUnitMap.value.ldName}</form:option>
		 				</c:forEach>
		 			 </form:select>
		 		</td>
		 		 
		 		<td> Department </td>
		 		<td> <form:select path="docDepttId" id="docDepttId"></form:select>
		 		</td>
		 	</tr>
		 	<tr class="even">
		 		<td> Periodicity </td>
		 		<td> <form:select path="renewable" id="docRenewableSelect" onchange="enableDisableFields('docRenewableSelect');">
		 				<form:option value="true">Limited</form:option>
		 				<form:option value="false">LifeTime</form:option>
		 			 </form:select> 
		 		</td>
		 		 		 
		 		<td> Period From: </td>
		 		<td> <form:input path="docValidityStartDate" id="docValidityStartDate"/> </td> 
		 		 
		 		<td> Period To: </td>
		 		<td> <form:input path="docValidityEndDate" id="docValidityEndDate" class="disableInputField"/> </td>
		 	</tr>
		 	<tr class="odd">	 		 
		 		<td> Owner Name </td>
		 		<td> <form:input path="docOwnerId" type="text" id="owner" onclick="showUserLookUpDialog();"/> </td>
		 		 
		 		<td> Uploader Name </td>
		 		<td> <form:input path="wfAssignedUser" type="text" id="uploader" onclick="showUserLookUpDialog();"/> </td>
		 		 	
		 		<td> Reviewer Name </td>
		 		<td> <form:input path="wfAssignedUser" type="text" id="reviewer" onclick="showUserLookUpDialogForWF('ROLE_REVIEWER');"/> </td>
		 	</tr>	
	 		<tr class="even">
	 			<td> Controller Name </td>
		 		<td> <form:input path="wfAssignedUser" type="text" id="controller" onclick="showUserLookUpDialogForWF('ROLE_APPROVER');"/> </td>
		 		
		 		<td colspan="4" align="right"> <input type="button" value="Generate Report" onclick="reportsTable();"> </td>
		 	</tr>
	 	</table>
	 </form:form>
 </div>
 <div id="reportsPage"></div>